<@override name="content">
<div class="header">
  <h1 class="page-title">登陆日志</h1>
</div>
<ul class="breadcrumb">
  <li>
    <a href="admin">首页</a>
    <span class="divider">/</span>
  </li>
  <li class="active">用户管理</li>
</ul>
<div class="container-fluid">
  <div class="row-fluid">
    <div class="well">
      <div id="container">
        <div class="pagination pagination-centered">
          <#include "../../common/_paginate.html" />
          <@paginate currentPage=logs.pageNumber totalPage=logs.totalPage actionUrl="admin/user/loginlog/" />
          <div class="pull-right">
            <span class="badge badge-info">${logs.pageNumber}/${logs.totalPage} Pages</span>
            <span class="badge badge-info">${logs.totalRow} Records</span>
          </div>
        </div>

        <table id="user-log" class="table table-hover table-condensed">
          <thead>
          <tr>
            <th>No.</th>
            <th>Uid</th>
            <th>Name</th>
            <th>IP</th>
            <th>Time</th>
            <th>Success</th>
          </tr>
          </thead>
          <tbody>
            <#if logs??>
              <#list logs.list as log>
              <tr>
                <td>${(logs.pageNumber-1) * logs.pageSize + log_index + 1}</td>
                <td>${log.uid!0}</td>
                <td><a href="user/profile/${log.name!}" target="_blank">${log.name!}</a></td>
                <td>${log.ip!}</td>
                <td class="timestamp" data="${log.ctime}"></td>
                <td>${log.success?string('<span class="label label-success">Y</span>', '<span class="label label-important">N</span>')}</td>
              </tr>
              </#list>
            </#if>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div>
</@override>

<@override name="scripts">
  <#if oj_style != "slate">
  <link rel="stylesheet" href="assets/tablecloth/css/tablecloth.css" type="text/css">
  <script src="assets/tablecloth/js/jquery.metadata.js"></script>
  <script src="assets/tablecloth/js/jquery.tablecloth.js"></script>
  </#if>

<script type="text/javascript">
  $(document).ready(function () {
    $('.timestamp').each(function () {
      $(this).html(getLocalTime($(this).attr('data')));
    });

    <#if oj_style != "slate">
      $("#user-log").tablecloth({
        theme: "stats",
        condensed: true,
        sortable: false,
        striped: true,
        clean: true
      });
    </#if>
  });
</script>
</@override>
<@extends name="../_layout.html" />
